-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add rule to detect private usages in imports from local modules #187
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This comment has been minimized.
This comment has been minimized.
DetachHead
force-pushed
the
private-import
branch
from
March 24, 2024 05:09
59476fe
to
5cb08f6
Compare
This comment has been minimized.
This comment has been minimized.
DetachHead
changed the title
add rule to detect private non-py.typed import usages
add rule to detect private non-Mar 24, 2024
py.typed
import usages
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
DetachHead
changed the title
add rule to detect private non-
add rule to detect private usages in imports from local modules
Mar 24, 2024
py.typed
import usages…ause third party modules without `py.typed` don't use explicit re-exports
This comment has been minimized.
This comment has been minimized.
Diff from mypy_primer, showing the effect of this PR on open source code: PyWinCtl (https://github.com/Kalmat/PyWinCtl)
+ /tmp/mypy_primer/projects/PyWinCtl/src/ewmhlib/__init__.py:23:21 - error: "displaysCount" is not exported from module "._main"
+ Import from "ewmhlib._ewmhlib" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/ewmhlib/__init__.py:23:36 - error: "getDisplays" is not exported from module "._main"
+ Import from "ewmhlib._ewmhlib" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/ewmhlib/__init__.py:23:49 - error: "getDisplaysInfo" is not exported from module "._main"
+ Import from "ewmhlib._ewmhlib" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/ewmhlib/__init__.py:23:66 - error: "getRoots" is not exported from module "._main"
+ Import from "ewmhlib._ewmhlib" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/ewmhlib/__init__.py:23:76 - error: "getRootsInfo" is not exported from module "._main"
+ Import from "ewmhlib._ewmhlib" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/ewmhlib/__init__.py:24:21 - error: "defaultDisplay" is not exported from module "._main"
+ Import from "ewmhlib._ewmhlib" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/ewmhlib/__init__.py:24:37 - error: "defaultScreen" is not exported from module "._main"
+ Import from "ewmhlib._ewmhlib" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/ewmhlib/__init__.py:24:52 - error: "defaultRoot" is not exported from module "._main"
+ Import from "ewmhlib._ewmhlib" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/ewmhlib/__init__.py:24:65 - error: "defaultEwmhRoot" is not exported from module "._main"
+ Import from "ewmhlib._ewmhlib" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/ewmhlib/__init__.py:25:21 - error: "getDisplayFromRoot" is not exported from module "._main"
+ Import from "ewmhlib._ewmhlib" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/ewmhlib/__init__.py:25:41 - error: "getScreenFromRoot" is not exported from module "._main"
+ Import from "ewmhlib._ewmhlib" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/ewmhlib/__init__.py:26:21 - error: "getDisplayFromWindow" is not exported from module "._main"
+ Import from "ewmhlib._ewmhlib" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/ewmhlib/__init__.py:26:43 - error: "getScreenFromWindow" is not exported from module "._main"
+ Import from "ewmhlib._ewmhlib" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/ewmhlib/__init__.py:26:64 - error: "getRootFromWindow" is not exported from module "._main"
+ Import from "ewmhlib._ewmhlib" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/ewmhlib/__init__.py:27:21 - error: "getProperty" is not exported from module "._main"
+ Import from "ewmhlib._ewmhlib" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/ewmhlib/__init__.py:27:34 - error: "getPropertyValue" is not exported from module "._main"
+ Import from "ewmhlib._ewmhlib" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/ewmhlib/__init__.py:27:52 - error: "changeProperty" is not exported from module "._main"
+ Import from "ewmhlib._ewmhlib" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/ewmhlib/__init__.py:27:68 - error: "sendMessage" is not exported from module "._main"
+ Import from "ewmhlib._ewmhlib" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/ewmhlib/__init__.py:28:21 - error: "EwmhRoot" is not exported from module "._main"
+ Import from "ewmhlib._ewmhlib" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/ewmhlib/__init__.py:28:31 - error: "EwmhWindow" is not exported from module "._main"
+ Import from "ewmhlib._ewmhlib" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/ewmhlib/_ewmhlib.py:25:28 - error: "Root" is not exported from module "ewmhlib.Props"
+ Import from "ewmhlib.Props._props" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/ewmhlib/_ewmhlib.py:25:34 - error: "DesktopLayout" is not exported from module "ewmhlib.Props"
+ Import from "ewmhlib.Props._props" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/ewmhlib/_ewmhlib.py:25:49 - error: "Window" is not exported from module "ewmhlib.Props"
+ Import from "ewmhlib.Props._props" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/ewmhlib/_ewmhlib.py:25:57 - error: "WindowType" is not exported from module "ewmhlib.Props"
+ Import from "ewmhlib.Props._props" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/ewmhlib/_ewmhlib.py:25:69 - error: "State" is not exported from module "ewmhlib.Props"
+ Import from "ewmhlib.Props._props" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/ewmhlib/_ewmhlib.py:25:76 - error: "StateAction" is not exported from module "ewmhlib.Props"
+ Import from "ewmhlib.Props._props" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/ewmhlib/_ewmhlib.py:26:28 - error: "MoveResize" is not exported from module "ewmhlib.Props"
+ Import from "ewmhlib.Props._props" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/ewmhlib/_ewmhlib.py:26:40 - error: "DataFormat" is not exported from module "ewmhlib.Props"
+ Import from "ewmhlib.Props._props" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/ewmhlib/_ewmhlib.py:26:52 - error: "Mode" is not exported from module "ewmhlib.Props"
+ Import from "ewmhlib.Props._props" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/ewmhlib/_ewmhlib.py:26:58 - error: "HintAction" is not exported from module "ewmhlib.Props"
+ Import from "ewmhlib.Props._props" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/ewmhlib/_ewmhlib.py:27:29 - error: "DisplaysInfo" is not exported from module "ewmhlib.Structs"
+ Import from "ewmhlib.Structs._structs" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/ewmhlib/_ewmhlib.py:27:43 - error: "ScreensInfo" is not exported from module "ewmhlib.Structs"
+ Import from "ewmhlib.Structs._structs" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/ewmhlib/_ewmhlib.py:27:56 - error: "WmHints" is not exported from module "ewmhlib.Structs"
+ Import from "ewmhlib.Structs._structs" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/ewmhlib/_ewmhlib.py:27:65 - error: "Aspect" is not exported from module "ewmhlib.Structs"
+ Import from "ewmhlib.Structs._structs" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/ewmhlib/_ewmhlib.py:27:73 - error: "WmNormalHints" is not exported from module "ewmhlib.Structs"
+ Import from "ewmhlib.Structs._structs" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/pywinctl/__init__.py
+ /tmp/mypy_primer/projects/PyWinCtl/src/pywinctl/__init__.py:27:25 - error: "Window" is not exported from module "._main"
+ Import from "pywinctl._pywinctl_linux" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/pywinctl/__init__.py:27:33 - error: "checkPermissions" is not exported from module "._main"
+ Import from "pywinctl._pywinctl_linux" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/pywinctl/__init__.py:27:51 - error: "getActiveWindow" is not exported from module "._main"
+ Import from "pywinctl._pywinctl_linux" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/pywinctl/__init__.py:28:21 - error: "getActiveWindowTitle" is not exported from module "._main"
+ Import from "pywinctl._pywinctl_linux" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/pywinctl/__init__.py:28:43 - error: "getAllAppsNames" is not exported from module "._main"
+ Import from "pywinctl._pywinctl_linux" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/pywinctl/__init__.py:28:60 - error: "getAllAppsWindowsTitles" is not exported from module "._main"
+ Import from "pywinctl._pywinctl_linux" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/pywinctl/__init__.py:29:21 - error: "getAllTitles" is not exported from module "._main"
+ Import from "pywinctl._pywinctl_linux" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/pywinctl/__init__.py:29:35 - error: "getAllWindows" is not exported from module "._main"
+ Import from "pywinctl._pywinctl_linux" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/pywinctl/__init__.py:29:50 - error: "getAppsWithName" is not exported from module "._main"
+ Import from "pywinctl._pywinctl_linux" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/pywinctl/__init__.py:29:67 - error: "getWindowsWithTitle" is not exported from module "._main"
+ Import from "pywinctl._pywinctl_linux" instead (reportPrivateLocalImportUsage)
+ /tmp/mypy_primer/projects/PyWinCtl/src/pywinctl/__init__.py:30:21 - error: "getTopWindowAt" is not exported from module "._main"
+ Import from "pywinctl._pywinctl_linux" instead (reportPrivateLocalImportUsage)
... (truncated 35 lines) ...
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes #104